import pymysql
def getKaoshiDefen(xuehao):
    conn=pymysql.connect("localhost","root","womenilu2580","stmanagement",charset='utf8')
    cur=conn.cursor()
    cur.execute("SELECT count(xuehao) FROM KAOSHI WHERE xuehao='"+xuehao+"'AND SHIFOUZHENGQUE='N'")
    temp=cur.fetchall()
    conn.close()
    xueshengXinxi=[]
    for line in temp:
        xueshengXinxi.append(line[0])
    return xueshengXinxi
print(getKaoshiDefen('2'))
